﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:C7"
	mc:Ignorable="d"
	x:Class="C7.MemoireModule"
	x:Name="Memoire"
	d:DesignWidth="1900" d:DesignHeight="880" FontFamily="/C7;Component/Resources/Fonts/#Zegoe UI Semi Bold - U" FontSize="26.667">
    <UserControl.Resources>
        <Storyboard x:Key="sbCloseGlow">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </ThicknessAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="sbrevCloseGlow">
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblClose" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="-35,0,0,0"/>
            </ThicknessAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="sbOKGlow">
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblOK" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </ThicknessAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblOK" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="sbrevOKGlow">
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblOK" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="0,0,-40,0"/>
            </ThicknessAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lblOK" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
				<Storyboard x:Key="FadeSelectIn">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PencilSizeBox" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PencilSizeBox" Storyboard.TargetProperty="(UIElement.IsHitTestVisible)">
				<DiscreteBooleanKeyFrame KeyTime="00:00:00.2000000" Value="True"/>
			</BooleanAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="FadeSelectOut">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PencilSizeBox" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="PencilSizeBox" Storyboard.TargetProperty="(UIElement.IsHitTestVisible)">
				<DiscreteBooleanKeyFrame KeyTime="00:00:00.2000000" Value="False"/>
			</BooleanAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="FadeColorIn">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ColorPickerBox" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ColorPickerBox" Storyboard.TargetProperty="(UIElement.IsHitTestVisible)">
				<DiscreteBooleanKeyFrame KeyTime="00:00:00.2000000" Value="True"/>
			</BooleanAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="FadeColorOut">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ColorPickerBox" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<BooleanAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ColorPickerBox" Storyboard.TargetProperty="(UIElement.IsHitTestVisible)">
				<DiscreteBooleanKeyFrame KeyTime="00:00:00.2000000" Value="False"/>
			</BooleanAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="FadeEraserIn">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EraserRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="FadeEraserOut">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EraserRectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="spClose">
            <BeginStoryboard Storyboard="{StaticResource sbCloseGlow}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="spClose">
            <BeginStoryboard x:Name="sbrevCloseGlow_BeginStoryboard" Storyboard="{StaticResource sbrevCloseGlow}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="spOK">
            <BeginStoryboard Storyboard="{StaticResource sbOKGlow}"/>
        </EventTrigger>
        <EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="spOK">
            <BeginStoryboard x:Name="sbrevOKGlow_BeginStoryboard" Storyboard="{StaticResource sbrevOKGlow}"/>
        </EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="pencil">
			<BeginStoryboard Storyboard="{StaticResource FadeSelectIn}" x:Name="FadeSelectIn_BeginStoryboard"/>
			<BeginStoryboard Storyboard="{StaticResource FadeColorOut}" x:Name="FadeColorOut_BeginStoryboard2"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="PencilSizeBox">
			<BeginStoryboard Storyboard="{StaticResource FadeSelectOut}" x:Name="FadeSelectOut_BeginStoryboard"/>
			<BeginStoryboard Storyboard="{StaticResource FadeColorOut}" x:Name="FadeColorOut_BeginStoryboard1"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="palette">
			<BeginStoryboard Storyboard="{StaticResource FadeColorIn}" x:Name="FadeColorIn_BeginStoryboard"/>
			<BeginStoryboard Storyboard="{StaticResource FadeSelectOut}" x:Name="FadeSelectOut_BeginStoryboard2"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="ColorPickerBox">
			<BeginStoryboard Storyboard="{StaticResource FadeColorOut}" x:Name="FadeColorOut_BeginStoryboard"/>
			<BeginStoryboard Storyboard="{StaticResource FadeSelectOut}" x:Name="FadeSelectOut_BeginStoryboard1"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseEnter" SourceName="eraser">
			<BeginStoryboard Storyboard="{StaticResource FadeEraserIn}"/>
			<BeginStoryboard Storyboard="{StaticResource FadeColorOut}" x:Name="FadeColorOut_BeginStoryboard3"/>
			<BeginStoryboard Storyboard="{StaticResource FadeSelectOut}" x:Name="FadeEraserOut_BeginStoryboard1"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="Mouse.MouseLeave" SourceName="eraser">
			<BeginStoryboard Storyboard="{StaticResource FadeEraserOut}" x:Name="FadeEraserOut_BeginStoryboard"/>
		</EventTrigger>
    </UserControl.Triggers>
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="0.03*"/>
            <RowDefinition Height="0.15*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="0.03*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.091*"/>
            <ColumnDefinition Width="0.9*"/>
            <ColumnDefinition Width="0.096*"/>
        </Grid.ColumnDefinitions>
        <StackPanel x:Name="spUpperControls" Margin="0,-32,0,0" VerticalAlignment="Top" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <StackPanel x:Name="spClose" HorizontalAlignment="Center" Orientation="Horizontal" d:LayoutOverrides="GridBox">
                <Image x:Name="imgClose" HorizontalAlignment="Left" VerticalAlignment="Top" Source="/C7;Component/Resources/Graphics/Icons/close.png" Height="{Binding ActualHeight, ElementName=lblClose, Mode=Default}"/>
                <Label x:Name="lblClose" Content="Close" FontFamily="/C7;Component/Resources/Fonts/#Avian" Foreground="White" VerticalAlignment="Center" Opacity="0" Margin="-33,0,0,0" FontSize="12"/>
            </StackPanel>
            <StackPanel x:Name="spOK" HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,-16,0,0">
                <Label x:Name="lblOK" Content="OK" FontFamily="/C7;Component/Resources/Fonts/#Avian" Foreground="White" VerticalAlignment="Center" Opacity="0" FontSize="21.333" Margin="0,0,-40,0"/>
                <Image x:Name="imgOK" HorizontalAlignment="Left" VerticalAlignment="Top" Source="/C7;Component/Resources/Graphics/Icons/OK.png" Height="40"/>
            </StackPanel>
        </StackPanel>
        <Rectangle x:Name="rectBaseColor" StrokeThickness="2" Grid.ColumnSpan="3" Grid.RowSpan="4" Fill="{Binding Fill, ElementName=rectHeader, Mode=Default}" OpacityMask="#5A000000"/>
        <Rectangle x:Name="rectBase" StrokeThickness="19" Grid.ColumnSpan="3" Grid.RowSpan="4">
            <Rectangle.OpacityMask>
                <LinearGradientBrush EndPoint="0.025,0.5" StartPoint="0.973,0.504">
                    <GradientStop Color="#66000000"/>
                    <GradientStop Color="#66000000" Offset="1"/>
                    <GradientStop Color="Black" Offset="0.04"/>
                    <GradientStop Color="Black" Offset="0.96"/>
                </LinearGradientBrush>
            </Rectangle.OpacityMask>
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="Gray" Offset="1"/>
                    <GradientStop Color="White"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Rectangle x:Name="rectBaseGradiant" StrokeThickness="19" Grid.ColumnSpan="3" Grid.RowSpan="4">
            <Rectangle.OpacityMask>
                <LinearGradientBrush EndPoint="0.025,0.5" StartPoint="0.973,0.504">
                    <GradientStop Color="#66000000"/>
                    <GradientStop Color="#66000000" Offset="1"/>
                    <GradientStop Color="Black" Offset="0.04"/>
                    <GradientStop Color="Black" Offset="0.96"/>
                </LinearGradientBrush>
            </Rectangle.OpacityMask>
            <Rectangle.Fill>
                <LinearGradientBrush EndPoint="0.02,0.5" StartPoint="0.973,0.5">
                    <GradientStop Offset="1"/>
                    <GradientStop/>
                    <GradientStop Color="White" Offset="0.5"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Grid x:Name="grdHeader" Margin="0,0,0,-0.001" Grid.Column="1" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="0.4*"/>
                <RowDefinition Height="3*"/>
            </Grid.RowDefinitions>
            <Rectangle x:Name="rectHeader" HorizontalAlignment="Left" Width="{Binding ActualWidth, ElementName=tbTitle, Mode=Default}">
                <Rectangle.Fill>
                    <SolidColorBrush Color="{DynamicResource mtBigBookColor}"/>
                </Rectangle.Fill>
            </Rectangle>
            <Rectangle x:Name="rectHeaderGradiant" HorizontalAlignment="Left" Width="{Binding ActualWidth, ElementName=tbTitle, Mode=Default}" OpacityMask="#85000000">
                <Rectangle.Fill>
                    <LinearGradientBrush EndPoint="0.044,0.616" StartPoint="0.968,0.51" MappingMode="RelativeToBoundingBox">
                        <GradientStop Color="Black"/>
                        <GradientStop Offset="1"/>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <TextBlock x:Name="tbTitle" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1" FontFamily="/C7;Component/Resources/Fonts/#Zegoe Caps" FontSize="48" Text="{DynamicResource mtBigBookTitle}" d:LayoutOverrides="HorizontalAlignment, GridBox"/>
        </Grid>
        <DockPanel x:Name="dpTinyStuff" Grid.ColumnSpan="3" Grid.RowSpan="4" LastChildFill="False" d:IsHidden="True">
            <Rectangle x:Name="rectTinyLeft" OpacityMask="#7F000000" Fill="{Binding Fill, ElementName=rectHeader, Mode=Default}" Width="1" DockPanel.Dock="Right"/>
            <Rectangle x:Name="rectTinyLower" Fill="{Binding Fill, ElementName=rectHeader, Mode=Default}" DockPanel.Dock="Bottom" OpacityMask="#7F000000" Height="1"/>
        </DockPanel>
        <Viewbox x:Name="grdInk" Width="Auto" Height="Auto" Grid.Column="1" Grid.Row="2">
        	<Grid Width="1573.13707451702" Height="630.695825049702">
        		<Grid.RowDefinitions>
        			<RowDefinition Height="0.22*"/>
        			<RowDefinition Height="0.78*"/>
        		</Grid.RowDefinitions>
        		<Grid.ColumnDefinitions>
        			<ColumnDefinition Width="0.037*"/>
        			<ColumnDefinition Width="0.963*"/>
        		</Grid.ColumnDefinitions>
        		<InkCanvas Width="Auto" Height="Auto" Background="{x:Null}" x:Name="DrawingArea" Grid.Column="1" Grid.RowSpan="2" MouseDown="DrawingArea_MouseDown"/>
        		<ListBox x:Name="lbPreviousDrawings" Background="#11000000" Foreground="{x:Null}" Grid.Row="1" ItemTemplate="{DynamicResource dtCanvas}" MouseDoubleClick="lbPreviousDrawings_MouseDoubleClick">
        			<ListBox.Resources>
        				<DataTemplate x:Key="dtCanvas">
        					<Grid>
        						<Image Source="{Binding Path=UriSource}" Stretch="UniformToFill"/>
        					</Grid>
        				</DataTemplate>
        			</ListBox.Resources>
        		</ListBox>
        		<Grid HorizontalAlignment="Left" Margin="12,11,0,47.802" Width="16">
        			<Grid VerticalAlignment="Top" Height="16" x:Name="StrokeSizeGrid">
        				<local:PencilSize d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" Margin="-8,-6,-149,-7" x:Name="PencilSizeBox" Opacity="0" IsHitTestVisible="False"/>
        				<Image x:Name="pencil" Source="/C7;Component/Resources/Graphics/Icons/pencil.png" Stretch="Fill" IsHitTestVisible="True" MouseLeftButtonDown="PenClicked"/>
        			</Grid>
        			<Grid Margin="0,32,0,32" x:Name="ColorChooserGrid">
        				<local:ColorPicker x:Name="ColorPickerBox" Opacity="0" Margin="-6.5,-7,-76.5,-6" Height="29" IsHitTestVisible="False"/>
        				<Image x:Name="palette" Source="/C7;Component/Resources/Graphics/Icons/palette.png" Stretch="Fill"/>
        			</Grid>
        			<Grid VerticalAlignment="Bottom" Height="16">
        				<Rectangle Fill="#FFF0F0F0" Stroke="#FFA1A1A1" RadiusX="4.5" RadiusY="4.5" Margin="-9,-7,-11,-6" x:Name="EraserRectangle" Opacity="0"/>
        				<Image IsHitTestVisible="True" x:Name="eraser" Source="/C7;Component/Resources/Graphics/Icons/comment_edit.png" Stretch="Fill" MouseLeftButtonDown="EraserClicked"/>
        			</Grid>
        			<Grid VerticalAlignment="Bottom" Height="16" Margin="0,0,0,-31">
        				<Rectangle Fill="#FFF0F0F0" Stroke="#FFA1A1A1" RadiusX="4.5" RadiusY="4.5" x:Name="EraserRectangle1" Opacity="0"/>
        				<Image Source="/C7;Component/Resources/Graphics/Icons/Eraser-icon.png" Stretch="Fill" Width="16" Height="16" MouseLeftButtonDown="Image_MouseLeftButtonDown"/>
        			</Grid>
        		</Grid>
        	</Grid>
        </Viewbox>
    </Grid>

</UserControl>